package com.qzdsoft.erpcloud.service.proj.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.qzdsoft.erpcloud.mapper.proj.MaterialQueryMapper;
import com.qzdsoft.erpcloud.service.proj.MaterialService;
import com.qzdsoft.erpcloud.vo.proj.MaterialInfo;
import com.qzdsoft.erpcloud.vo.proj.MaterialQueryInfo;
import com.qzdsoft.vo.LayTableResponse;

@Service
public class MaterialServiceImpl implements MaterialService {

	@Autowired
	private MaterialQueryMapper materiaQueryMapper;
	
	@Override
	public List<MaterialInfo> selectBy(MaterialQueryInfo param) {
		return materiaQueryMapper.selectBy(param);
	}

    @Override
    public LayTableResponse<MaterialInfo> selectPageBy(MaterialQueryInfo info)
    {
        PageHelper.startPage(info.getPage(),info.getLimit());
        List<MaterialInfo> materiaInfos = materiaQueryMapper.selectBy(info);
        return new LayTableResponse<>(materiaInfos);
    }

}
